package com.dragon.modules.yuegou.model.message;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.time.LocalDateTime;

/**
 * 验证码
 * 
 * @author liuwu
 *
 */
public class Vcode {

	/**
	 * 验证码值
	 */
	private String code;

	/**
	 * 失效时间
	 */
	private LocalDateTime expiredTime;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public LocalDateTime getExpiredTime() {
		return expiredTime;
	}

	public void setExpiredTime(LocalDateTime expiredTime) {
		this.expiredTime = expiredTime;
	}

	@JsonIgnore
	public boolean isExpired() {
		return LocalDateTime.now().isAfter(expiredTime);
	}
}
